﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Forms;
using System.Net.Sockets;

namespace AndrewTicTacToe
{


    class GameClient
    {   public TcpClient clientSocket;
        public StreamWriter sender;

        public GameClient()
        {
            clientSocket = new TcpClient();
        }
        

        public void connectToServer(String ipAddress)
        {
            //Try connecting to the Server using the given IP address 
            // Through port 1300
            try
            {
                clientSocket.Connect(ipAddress, 1300);
                sender = new StreamWriter(clientSocket.GetStream());

            }

            // If attempt to connect to server fails: Do the following
            catch (Exception)
            {
                MessageBox.Show("Client: Server is offline", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }


    }



}
